js.adminmanage_class = {}


js.adminmanage_class.cog = function(can){
	var me = this;
	js.baseclass.call(this, can); //这个必须要写，继承默认的方法
	
	this.changecolor = function(){
		var zys = ['#1389D3','#99cc66','#003366','#6666CC','#CC3333','#009966','#333333','#990066','#333300','#333366','#99CC99','#663366','#003399','#338899'];
		var h 	= '<div style="padding:10px"><table height="20px" class="cursor"><tr>';
		var nst = '';
		for(var i=0;i<zys.length;i++){
			nst = (zys[i]==maincolor) ? '✔':'&nbsp;';
			h+='<td width="20px" style="color:white;font-size:12px" align="center" onclick="js.location(\'?m=adminmanage&apptheme='+zys[i].substr(1)+'\')" bgcolor="'+zys[i]+'">'+nst+'</td>';
		}
		h+='</tr></table></div>';
		js.modal.main({
			width:310,height:200,
			html:h,
			title:'选择主题色'
		});
	}
}


js.adminmanage_class.filelist = function(can){
	var me = this;
	js.baseclass.call(this, can);
	if(!this.path)this.path='';
	this.onPage = function(){
		var tablecans = {
			url:'?m=adminmanage&a=filelistdata',
			fanye:false,checked:false,caozuo:false,urlparams:{path:this.path},autoheight:true,resizeh:22,height:300,
			view:'table_view'+this.rand+'',
			columns:[{
				text:'类型',dataIndex:'ismulu',width:50,renderer:function(val){
					var str = ''+urlstatic+'webstatic/images/folder.png';
					if(val=='0')str = ''+urlstatic+'webstatic/images/file.png';
					return '<img src="'+str+'" width="20" height="20">';
				}
			},{
				text:'名称',dataIndex:'name',align:'left'
			},{
				text:'大小',dataIndex:'size'
			},{
				text:'说明',dataIndex:'sm'
			},{
				text:'修改时间',dataIndex:'editdt'
			}],
			onitemdblclick:function(d){
				me.onitemdblclick(d);
			},
			onloadbefore:function(d){
				me.onloadbefore(d);
			}
		}
		this.table = new js.table.create(tablecans);
	}
	
	this.genmulu = function(){
		this.openmulu('');
	}
	
	this.openmulu = function(val){
		this.table.setparams({path:val}, true)
	}
	
	this.onitemdblclick = function(d){
		if(d.ismulu==1){
			this.openmulu(d.path);
		}else{
			js.open('?m=adminmanage&a=syslog&file='+d.path+'');
		}
	}
	
	this.onloadbefore = function(d){
		var ov = $('#path_'+this.rand+'');
		ov.html('');
		if(d.path){
			var patha = d.path.split('/'),s1='';
			for(var i=0;i<patha.length; i++){
				if(i>0)ov.append('<font style="margin:0px 5px" color="gray">/</font>');
				if(i>0)s1 += '/';
				s1 += patha[i];
				ov.append('<a onclick="'+this.clickact('openmulu')+'(\''+jm.base64encode(s1)+'\')" href="javascript:;">'+patha[i]+'</a>');
			}
		}
		ov.append('&nbsp;<span style="font-size:14px;" class="hui">目录'+d.countmulu+'个，文件'+d.countfile+'个</span>')
	}
}